package com.zego.wawaji.ui.center.wawa;

import android.os.Parcel;
import android.os.Parcelable;

import com.zego.wawaji.base.data.BaseData;

import org.json.JSONObject;

/**
 * 兑换娃娃币
 * Created by Su on 2017/12/6.
 */
public class Exchange extends BaseData implements Parcelable {
    private int exchangeNum;

    @Override
    public void parseJson(String jsonStr) {
        JSONObject jsonObject = getJsonObject(jsonStr);

        this.exchangeNum = jsonObject.optInt("ExchangeWwCoinZs");
    }

    public int getExchangeNum() {
        return exchangeNum;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.exchangeNum);
    }

    public Exchange() {
    }

    protected Exchange(Parcel in) {
        this.exchangeNum = in.readInt();
    }

    public static final Parcelable.Creator<Exchange> CREATOR = new Parcelable.Creator<Exchange>() {
        @Override
        public Exchange createFromParcel(Parcel source) {
            return new Exchange(source);
        }

        @Override
        public Exchange[] newArray(int size) {
            return new Exchange[size];
        }
    };
}
